import request from '@/config/axios'

// 传承创新申报 VO
export interface DeclarationInfoVO {
  id: number // ID
  userId: number // 用户ID
  processInstanceId: string // 流程编号
  type: number // 申报类型
  startTime: Date // 开始时间
  endTime: Date // 结束时间
  agencyName: string // 机构名字
}

// 传承创新申报 API
export const DeclarationInfoApi = {
  // 查询传承创新申报分页
  getDeclarationInfoPage: async (params: any) => {
    return await request.get({ url: `/bpm/declaration-info/page`, params })
  },

  // 查询传承创新申报详情
  getDeclarationInfo: async (id: number) => {
    return await request.get({ url: `/bpm/declaration-info/get?id=` + id })
  },

  // 新增传承创新申报
  createDeclarationInfo: async (data: DeclarationInfoVO) => {
    return await request.post({ url: `/bpm/declaration-info/create`, data })
  },

  // 修改传承创新申报
  updateDeclarationInfo: async (data: DeclarationInfoVO) => {
    return await request.put({ url: `/bpm/declaration-info/update`, data })
  },

  // 删除传承创新申报
  deleteDeclarationInfo: async (id: number) => {
    return await request.delete({ url: `/bpm/declaration-info/delete?id=` + id })
  },

  // 导出传承创新申报 Excel
  exportDeclarationInfo: async (params) => {
    return await request.download({ url: `/bpm/declaration-info/export-excel`, params })
  }
}